<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/30
 * Time: 11:17
 */

namespace app\admin\validate;


class Goods extends BaseValidate
{
    // 批量验证
    protected $batch = true;
    protected $rule = array(
        'add' => array(
            'goods_name' => 'require|max:20',
            'goods_price' => 'require|/^\d+(\.\d{1,2})?$/',
            'goods_number' => 'require|isPositiveInteger',
            'goods_introduce' => 'max:200',
            'goods_logo' => 'require'
        ),
        'del' => array(
            'id' => 'require|isPositiveInteger'
        )
    );
    protected $message = [
        'goods_name.require' => '请输入名称',
        'goods_name.max' => '名称长度小于20',
        'goods_price.require' => '价格保留两位有效数字',
        'goods_price.regex' => '价格保留两位有效数字',
        'goods_number.isPositiveInteger' => '数量必须为整数',
        'goods_introduce.max' => '长度不能超过200',
        'goods_logo.require' => '上传图片'
    ];



}